import Vue from 'vue'
import VueRouter from 'vue-router'
import PagesNav from '../views/pages/pagesnav/PagesNav.vue'
import ComperhenSive from '../views/pages/pagescontent/ComprehenSive.vue'
import Recommended from '../components/pagesnavChildren/Recommended.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'pages',
    component: PagesNav,
    redirect: '/recommend', //默认显示子级路由
    children: [
      {
        path:'/recommend', //综合
        // path:'',
        component: ComperhenSive,
        redirect: '/recommended',
        children: [
          {
            path: '/recommended',
            // path: '/',
            component: Recommended
          },
          {
            path: '/latest',
            component: () => import('../components/pagesnavChildren/Latest.vue')
          },
          {
            path: '/hotlist',
            component: () => import('../components/pagesnavChildren/HotList.vue')
          },
        ],
      },
      {
        path:'/focus',
        component: () => import('../views/pages/pagescontent/Focus.vue')
      },
      {
        path:'/frontend',
        component: () => import('../views/pages/pagescontent/FrontEnd.vue')
      },
      {
        path:'/backend',
        component: () => import('../views/pages/pagescontent/BackEnd.vue')
      },
      {
        path:'/android',
        component: () => import('../views/pages/pagescontent/Android.vue')
      },
      {
        path:'/ios',
        component: () => import('../views/pages/pagescontent/Ios.vue')
      },
      {
        path:'/ai',
        component: () => import('../views/pages/pagescontent/Ai.vue')
      },
      {
        path:'/developmenttools',
        component: () => import('../views/pages/pagescontent/DevelopmentTools.vue')
      },
      {
        path:'/codelife',
        component: () => import('../views/pages/pagescontent/CodeLife.vue')
      },
      {
        path:'/reading',
        component: () => import('../views/pages/pagescontent/Reading.vue')
      },
    ]
  },
  {
    path: '/boilingpoint',
    name: 'boilingpoint',
    component: () => import('../views/boilingpoint/boilingpointnav/BoilingpointNav.vue')
  },
  {
    path: '/course',
    name: 'course',
    component: () => import('../views/course/coursenav/CourseNav.vue')
  },
  {
    path: '/live',
    name: 'live',
    component: () => import('../views/live/livenav/LiveNav.vue')
  },
  {
    path: '/activity',
    name: 'activity',
    component: () => import('../views/activity/activitynav/ActivityNav.vue')
  },
  {
    path: '/post',
    name: 'post',
    component: () => import('../views/post/Post.vue')
  },
]

const router = new VueRouter({
  routes,
  mode: 'history',
  // linkActiveClass: 'active'
})

export default router
